<?php

namespace App\Strategies;

use App\Helpers\Formater\NumberFormater;
use App\Models\Factory\UserFactory;
use App\Strategies\AppStrategy;

/**
 * 提现流水策略
 *
 * Class UserStrategy
 * @package App\Strategies
 */
class CashStrategy extends AppStrategy
{

    /**
     * 交易号
     */
    public static function creditNid()
    {
        $nid = date('Y') . date('m') . date('d') . date('H') . date('i') . date('s') . UserStrategy::getRandChar(6);
        return 'account-cash' . $nid;
    }


    //积分兑换流水号
    public static function creditCreditNid()
    {
        $nid = date('Y') . date('m') . date('d') . date('H') . date('i') . date('s') . UserStrategy::getRandChar(6);
        return 'Credit-cash' . $nid;
    }

    //邀请好友流水号
    public static function creditInviteNid()
    {
        $nid = date('Y') . date('m') . date('d') . date('H') . date('i') . date('s') . UserStrategy::getRandChar(6);
        return 'Invite-cash' . $nid;
    }


    /**
     * 支付宝账号加**
     */
    public static  function  handleAccount($account)
    {
        if(strpos('@', $account))
        {

            return $account = substr_replace($account, '****',3,6);

        }else{

            return $account = substr_replace($account, '****', 3,4);
        }
    }


    //现金流水,通过type类型转化是否显示处理中

    public static  function toStatus($type)
    {
        if($type == 1)
        {
           return  $status= '处理中';
        }else{

           return  $status = '';
        }

    }


}
